Skip to content

docs: add personal-dev troubleshooting section and CI validation tests - #7367

Draft
Moises Cassidy (moisescassidy) wants to merge 1 commit into
Azure:mainfrom
moisescassidy:feat/add-personal-dev-readme-tests
Draft

Moises Cassidy (moisescassidy) wants to merge 1 commit into
Azure:mainfrom
moisescassidy:feat/add-personal-dev-readme-tests

Conversation

@moisescassidy

@moisescassidy Moises Cassidy (moisescassidy) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

docs/personal-dev.md is the entry point for every engineer setting up a personal dev environment, but nothing keeps it honest. When a make target is renamed or removed, the guide silently rots and the next person to follow it hits a failure that looks like a broken environment rather than a stale doc.

This adds an executable check so documentation drift fails in CI instead of being discovered by the next onboarding engineer, and fills the largest gap in the guide itself: what to do when setup times out or errors.

The problem is not hypothetical. Rebasing this branch onto current main immediately surfaced that infra.tracing — documented and valid at the branch's original base — had been removed upstream by 776552a ("fix: Remove Jaeger tracing infrastructure") with no replacement. That is exactly the class of drift this suite is meant to catch.

What

The test suite

  • test/docs/personal-dev-readme-test.sh — assertions over docs/personal-dev.md: required sections exist, documented make targets resolve via make -n, the az version floor and PERSIST flag are documented, cleanup retention periods and resource-group naming patterns match, Azure IDs are well-formed GUIDs, and internal links resolve on disk.
  • make test-docs — local entry point.
  • test/docs/README.md — how to run and extend the suite.

A troubleshooting section in the guide

Setup is long-running and talks to a lot of Azure APIs, so partial failures are routine, but the guide covered only the happy path. The new section documents levers that already existed and were undiscoverable: that re-running is resumable via the .step-cache; the three artifacts a run leaves behind (_artifacts/junit_entrypoint.xml, timing/steps.yaml, _artifacts/config.yaml); make visualize and make graph/entrypoint/Region; and LOG_LEVEL.

It separates the two timeouts that are easy to confuse — --deployment-timeout-seconds (default 180) governs waiting for an earlier deployment of the same pipeline, not the deployment itself, while unbounded --concurrency is the likelier cause of throttling-driven failures.

CI

  • .github/workflows/docs-validation.yml — markdown lint + README tests.
  • .markdownlint.json — lint config.

The suite is hermetic

TEST_MODE=dry-run (the default, and what CI runs) makes assertions about documentation only: no tooling, no network, no Azure access. Verified under a stripped network namespace — 11/11, exit 0. TEST_MODE=full adds local az / kubectl availability checks — 13/13. An unrecognised value exits 2 rather than silently falling back.

Because dry-run needs no tooling, the CI job installs neither Azure CLI nor kubectl. There are no external downloads in this workflow.

Link checking is offline. Targets carrying a URI scheme (http:, https:, mailto:, ...) and same-page #anchor links are skipped rather than fetched; everything else resolves against the filesystem relative to the file under test. The trade-off is deliberate — dead external URLs are not caught, in exchange for a suite that cannot fail because a third-party site is slow, rate-limiting, or behind a login.

Link extraction uses an awk match() loop. The greedy grep pattern it replaces collapsed every link on a line into a single match and kept only the last, silently dropping high-level-architecture.md from validation. awk rather than grep -P because BSD grep on macOS has no PCRE. Net: 6 of 8 links verified, up from 4.

Markdown linting is scoped, deliberately

Linting **/*.md is not viable here: roughly 3348 lines across 198 files exceed the 120-column limit, all predating this config. An unscoped job would fail on every PR for reasons unrelated to the change under review.

The lint step runs against the intersection of two constraints — files the change actually touches, and an allowlist (docs/personal-dev.md, test/docs/) — and is skipped when that set is empty. Widen the allowlist as more docs are brought up to standard, rather than relaxing the rules.

To make that allowlist honest rather than a trap, this PR also reflows 22 over-length lines in docs/personal-dev.md. That change is whitespace only: a word-level diff shows no prose added or removed outside the new section.

MD028 is disabled. GitHub alert blocks (> [!NOTE], > [!CAUTION]) are adjacent blockquotes separated by a blank line, which the rule reports as a blank inside one blockquote. The pattern is idiomatic and used throughout these docs.

CI/CD changes (called out per CONTRIBUTING.md §6)

This PR adds .github/workflows/docs-validation.yml, a new GitHub Actions workflow with two jobs. Reviewers should look at this closely:

  • Declares least-privilege permissions: contents: read.
  • One third-party action, pinned to a release tag: nosborn/github-action-markdown-cli@v3.3.0. The changed-file list is computed with plain git diff rather than pulling in a second action.
  • No curl | sh, no external downloads, no secrets consumed.
  • fetch-depth: 0 on the lint job's checkout, required for the base diff to resolve. Base revision comes from the pull_request event, falling back to the previous commit when absent or unresolvable (first push to a branch, force push).

It also adds a new executable script under test/docs/. Per our own review policy, new executable scripts in tooling directories warrant explicit human review.

Verification

Scenario Result
TEST_MODE=dry-run, no network namespace 11/11, exit 0
TEST_MODE=full 13/13, exit 0
TEST_MODE=bogus exit 2, diagnostic on stderr
make test-docs 11/11, exit 0
Run from outside the repo root 11/11, exit 0
Fixture with a broken link sharing a line with a valid one correctly fails, names the broken target
Lint gate simulated against this PR's own diff lints both in-scope files, exit 0
Base-SHA fallback: empty / all-zeros / bogus degrades to HEAD^, no crash under set -euo pipefail

Non-goals

Does not validate README.md or any doc other than docs/personal-dev.md. Does not execute any documented command that touches Azure — assertions are static plus make -n. Does not verify external URLs or heading anchors. Does not bring the other 197 files with lint violations up to standard.

Tracking

No existing Jira ticket. Filed as developer-experience maintenance work; happy to attach one if the team prefers a tracked item before this leaves Draft.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:58
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs, /pipeline remaining to request missing second-stage tests, or /pipeline required to rerun the selected second-stage set.

@openshift-ci openshift-ci Bot added area/ci Automatically applied by owners-label for area/ci area/test Automatically applied by owners-label for area/test needs-ok-to-test labels Oct 5, 2026
@openshift-ci

openshift-ci Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Hi Moises Cassidy (@moisescassidy). Thanks for your PR.

I'm waiting for a Azure member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The CI workflow has unsafe mutable downloads, requires manual review, and currently contains checks guaranteed to fail.

Review effort: Balanced
Findings: 4 High severity · 3 Medium severity · 1 Low severity

Open (8)
What changed in this PR

Adds automated validation to prevent docs/personal-dev.md from drifting from repository behavior.

Changes:

  • Adds documentation assertions and a local make test-docs target.
  • Adds Markdown linting and link-check configuration.
  • Adds a GitHub Actions validation workflow.
File Description
test/​docs/​README.md Documents the test suite and usage.
test/​docs/​personal-dev-readme-test.sh Implements personal-dev guide checks.
Makefile Adds the documentation test target.
.markdownlint.json Configures Markdown linting.
.markdown-link-check.json Configures link validation.
.github/​workflows/​docs-validation.yml Runs documentation checks in CI.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread test/docs/README.md Resolved
Comment thread test/docs/personal-dev-readme-test.sh Resolved
Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread test/docs/personal-dev-readme-test.sh Resolved
Comment thread test/docs/personal-dev-readme-test.sh Resolved
@@ -0,0 +1,299 @@
#!/usr/bin/env bash
Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/docs-validation.yml Outdated
Comment on lines +1 to +15
name: Documentation Validation

on:
pull_request:
paths:
- '**.md'
- 'test/docs/**'
- '.github/workflows/docs-validation.yml'
- '.markdownlint.json'
push:
branches:
- main
paths:
- '**.md'
- 'test/docs/**'
Comment thread test/docs/README.md Resolved
Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread test/docs/personal-dev-readme-test.sh Outdated
Comment on lines +125 to +127

for target in "${targets[@]}"; do
# For entrypoint targets, they're dynamically generated, so just check the pattern exists
Comment thread test/docs/personal-dev-readme-test.sh Outdated
Comment on lines +178 to +183

# Test 8: Validate Azure tenant ID and subscription ID format
test_azure_ids_format() {
test_start "Azure IDs are valid GUIDs"

# Extract tenant and subscription IDs from README (macOS compatible)
Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The workflow misses Makefile-only changes, currently lints a nonconforming tree, and uses a mutable third-party action reference.

Review effort: Balanced
Findings: 5 High severity · 5 Medium severity · 1 Low severity

Open (11)
Resolved since last review (4)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Add Makefile to workflow path filters

.github/​workflows/​docs-validation.yml:16

The workflow does not trigger when Makefile changes, so the target-removal scenario this suite is intended to catch can merge without running the documentation tests. Add the root Makefile to both event path filters (and keep the push filter aligned with the PR filter).

Medium severity Ensure tests cover all documented make targets

test/​docs/​personal-dev-readme-test.sh:119

The hard-coded list is not “all documented make targets”: it omits the documented pipeline/<name> target and both make -C dev-infrastructure ...-miwi-pg-connect commands. It also lets future commands be added to the guide without being tested. Extract make invocations from the document (including -C) or add a completeness assertion so the suite actually detects this drift.

Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread test/docs/personal-dev-readme-test.sh Outdated
test_start "kubectl is installed"
if command -v kubectl &>/dev/null; then
local version
version=$(kubectl version --client -o yaml 2>/dev/null | awk '/gitVersion:/ { print $2; exit }')

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The new CI workflow and executable script require human security review and have unresolved validation gaps.

Review effort: Balanced
Findings: 2 High severity · 4 Medium severity · 1 Low severity

Open (7)
Resolved since last review (4)
Previously missed (4)

In code that hasn't changed since last review

Medium severity Include Makefile changes in workflow path filters

.github/​workflows/​docs-validation.yml:16

The validation workflow does not run when the root Makefile changes. Renaming or removing one of the documented targets would therefore skip this check entirely, which defeats the primary drift scenario this workflow is intended to catch. Include Makefile changes in both PR and push path filters.

Medium severity Validate all documented Make targets

test/​docs/​personal-dev-readme-test.sh:119

This hard-coded list is not complete: docs/personal-dev.md:119 and :126 also document make -C dev-infrastructure cs-miwi-pg-connect and maestro-miwi-pg-connect. Either target can disappear while this test remains green, despite the test claiming to validate all documented make targets. Extract the invocations from the document or include directory/target pairs in the validation.

This issue also appears on line 125 of the same file.

Medium severity Compare documented retention values with policy

test/​docs/​personal-dev-readme-test.sh:158

This only checks that the documentation still contains two hard-coded strings; it never compares them with the authoritative olderThan values in tooling/cleanup-sweeper/resourcegroups.policy.yaml. A policy retention change would leave stale documentation and this test would still pass. Derive or compare the documented values against that policy and trigger the workflow when the policy changes.

Medium severity Validate documented cleanup patterns against policy

test/​docs/​personal-dev-readme-test.sh:167

These regexes validate only the -svc and -mgmt examples, not the cleanup-sensitive prefixes and -shared-resources suffix that the guide links to resourcegroups.policy.yaml for. Changes to the actual cleanup naming rules can therefore leave the guide stale without failing this test. Compare the documented cleanup patterns with the policy source instead.

Copilot AI balanced review requested due to automatic review settings October 8, 2026 04:40
@openshift-ci openshift-ci Bot added the area/docs Automatically applied by owners-label for area/docs label Oct 8, 2026
@moisescassidy Moises Cassidy (moisescassidy) changed the title test: add documentation tests for the personal-dev guide docs: add personal-dev troubleshooting section and CI validation tests Oct 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/docs-validation.yml Resolved
Comment thread test/docs/personal-dev-readme-test.sh Outdated
Comment on lines +118 to +119
local targets=("personal-dev-env" "local-pers-dev-env" "infra.svc.aks.kubeconfigfile"
"infra.mgmt.aks.kubeconfigfile" "cleanup-entrypoint/Region")
Comment thread test/docs/personal-dev-readme-test.sh Outdated
Comment on lines +125 to +136
# For entrypoint targets, they're dynamically generated, so just check the pattern exists
if [[ "${target}" == *"/"* ]]; then
if ! grep -q "entrypoint/" Makefile; then
log_error " Make target pattern '${target}' not found in Makefile"
all_exist=false
fi
else
if ! make -n "${target}" &>/dev/null; then
log_error " Make target '${target}' not found or invalid"
all_exist=false
fi
fi
Comment thread .github/workflows/docs-validation.yml Outdated
@@ -0,0 +1,82 @@
name: Documentation Validation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this workflow to Docs: Validate Documentation so it follows the purpose-based Actions sidebar naming convention in PR #8297. The filename and triggers can stay as they are.

Adds an executable check so documentation drift fails in CI instead of
being discovered by the next onboarding engineer, and fills the largest
gap in the guide: what to do when setup times out or errors.

- test/docs/personal-dev-readme-test.sh — assertions over
  docs/personal-dev.md (make targets via make -n, az version floor,
  PERSIST flag, cleanup retention, resource-group patterns, GUIDs,
  internal links)
- make test-docs — local entry point (via bash, no exec-bit dependency)
- test/docs/README.md — how to run and extend the suite
- .github/workflows/docs-validation.yml — markdown lint + README tests
  (pinned to SHAs, baseline fallback when only config changes)
- .markdownlint.json — lint config (MD060 disabled for tables)
- docs/personal-dev.md — reflow to 120 cols, add troubleshooting section
  covering .step-cache, _artifacts, timing, LOG_LEVEL, timeouts,
  concurrency, and cleanup

Co-Authored-By: Claude Code <noreply@anthropic.com>
@moisescassidy
Moises Cassidy (moisescassidy) force-pushed the feat/add-personal-dev-readme-tests branch from 0949c03 to 12cfbe4 Compare November 27, 2026 20:40
Copilot AI balanced review requested due to automatic review settings November 27, 2026 20:40
@openshift-ci

openshift-ci Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: moisescassidy
Once this PR has been reviewed and has the lgtm label, please assign roivaz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +5 to +15
paths:
- '**.md'
- 'test/docs/**'
- '.github/workflows/docs-validation.yml'
- '.markdownlint.json'
push:
branches:
- main
paths:
- '**.md'
- 'test/docs/**'
Comment on lines +66 to +75
awk '{
rest = $0
while (match(rest, /\[[^]]*\]\([^)]*\)/)) {
link = substr(rest, RSTART, RLENGTH)
sub(/^\[[^]]*\]\(/, "", link)
sub(/\)$/, "", link)
print link
rest = substr(rest, RSTART + RLENGTH)
}
}' "$1"
Comment on lines +118 to +121
local targets=("personal-dev-env" "local-pers-dev-env" "infra.svc.aks.kubeconfigfile"
"infra.mgmt.aks.kubeconfigfile" "cleanup-entrypoint/Region"
"visualize" "graph/entrypoint/Region" "pipeline/RP.Frontend"
"entrypoint/Region" "validate-config-pipelines" "install-tools")
for target in "${targets[@]}"; do
# Use --dry-run with -q where possible to avoid triggering binary builds
# that make -n would start (e.g. templatize rebuild for visualize).
if ! timeout 10 make -n "${target}" &>/dev/null; then
for target in "${targets[@]}"; do
# Use --dry-run with -q where possible to avoid triggering binary builds
# that make -n would start (e.g. templatize rebuild for visualize).
if ! timeout 10 make -n "${target}" &>/dev/null; then
Comment on lines +129 to +130
if ! timeout 10 make -n "${target}" &>/dev/null; then
rc=$?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Automatically applied by owners-label for area/ci area/docs Automatically applied by owners-label for area/docs area/test Automatically applied by owners-label for area/test do-not-merge/work-in-progress needs-ok-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants